package com.misakyanls.examples.random;

import static com.misakyanls.examples.random.NotSortedCollectionMatcher.notSorted;
import static com.misakyanls.examples.random.UniqueCollectionMatcher.containsOnlyUniques;
import static org.junit.Assert.assertThat;

import java.util.List;

import org.junit.Before;
import org.junit.Test;

public class RandomListBehaviour {

	private RandomList randomList;

	@Before
	public void createRandomList() {
		randomList = new RandomList();
	}

	@Test
	public void shouldFillListWithUniqueSortedValues() {
		// Given see createRandomList();

		// When
		List<Integer> list = randomList.createListWithUniqueSortedValues(10, 36);

		// Then
		assertThat(list, containsOnlyUniques());
	}

	@Test
	public void shouldPrintAllValuesOfListInRandomOrder() {
		// Given see createRandomList();

		// When
		List<Integer> list = randomList.createListWithUniqueSortedValues(10, 36);
		List<Integer> rotatedList = randomList.rotateList(list);

		// Then
		assertThat(rotatedList, containsOnlyUniques());
		assertThat(rotatedList, notSorted());
		System.out.println("Given list is :" + list);
		System.out.println("Arbitary list is :" + rotatedList);
	}

}
